package com.maimang.platform.crm.service;

import com.dingtalk.api.response.OapiDepartmentGetResponse;
import com.dingtalk.api.response.OapiDepartmentListIdsResponse;
import com.dingtalk.api.response.OapiDepartmentListParentDeptsByDeptResponse;
import com.dingtalk.api.response.OapiDepartmentListResponse;

/**
 * @author Rocky
 * @version 1.0.0
 * @classname DingTalkDeptService
 * @description <br>钉钉部门管理service</br>
 * @date 2019-09-22 13:37
 * @email jintaozhao@qq.com
 */
public interface DingTalkDeptService {

	/**
	 * 获取部门列表
	 *
	 * @param id         父部门id（如果不传，默认部门为根部门，根部门ID为1）
	 * @param fetchChild 是否递归部门的全部子部门，ISV微应用固定传递false
	 * @return OapiDepartmentListResponse
	 * @throws Exception
	 */
	OapiDepartmentListResponse getDeptList(String id, Boolean fetchChild) throws Exception;

	/**
	 * 获取部门详情
	 *
	 * @param id 部门id
	 * @return 部门详情对象
	 * @throws Exception
	 */
	OapiDepartmentGetResponse getDeptDetail(String id) throws Exception;



	/**
	 * 获取子部门ID列表
	 * @param id 父部门id。根部门的话传1
	 * @return
	 * @throws Exception
	 */
	OapiDepartmentListIdsResponse getDeptIds(String id) throws Exception;

	/**
	 * 查询部门的所有上级父部门路径
	 *
	 * @param id 部门id
	 * @return
	 * @throws Exception
	 */
	OapiDepartmentListParentDeptsByDeptResponse listParentDeptsByDept(String id) throws Exception;
}
